<template>
  <div class="vhead-content-txt fr">
    <div class="vhead-location fl" v-if="false">
      <Icon type="location"></Icon>&nbsp;
      <select v-model="selCity" class="vhead-city">
        <option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</option>
      </select>
    </div>
    <div class="vhead-admin fl">
      <img src="../../assets/img/common/admin.png" class="vhead-admin-photo fl">
      <span class="vhead-admin-name">{{loginName}}</span>
    </div>
    <div class="vhead-quit fl" @click="exitLogin">
      <Icon type="android-exit"></Icon>
      <span class="vhead-quit-txt">退出</span>
    </div>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        loginName: JSON.parse(sessionStorage.getItem('loginName')),
        cityList: [
          {
            value: 'beijing',
            label: '北京市'
          },
          {
            value: 'shanghai',
            label: '上海市'
          },
          {
            value: 'shenzhen',
            label: '深圳市'
          },
          {
            value: 'hangzhou',
            label: '杭州市'
          },
          {
            value: 'nanjing',
            label: '南京市'
          },
          {
            value: 'chongqing',
            label: '重庆市'
          }
        ],
        selCity: 'beijing'
      }
    },
    methods: {
      exitLogin () {
        sessionStorage.clear()
        this.$router.push('/login')
      }
    }
  }
</script>
